
@extends('master/master_index')

@section('title')
    <title>搜索界面</title>
@endsection

@section('css')
    <link rel="stylesheet" type="text/css" href="{{asset('home/css/msg.css')}}">
@endsection

@section('content')
    <div class="search_wrap_div">
        <div class="sea_top">
            <i class="Hui-iconfont">&#xe709;</i>关于' <span class="sea_key">{{$value}}</span> '的搜索结果，共{{count($user)+count($topic)}}条
        </div>
        <ul class="sea_result">
            @if(count($user)>0)
                @foreach($user as $u)
                <li class="sea_li">
                    <img src="{{asset($u->profile->avatar)}}">
                    <p><a href="{{url('userCenter')}}/user={{$u->id}}">{!!str_replace($value,"<font color=indianred><b>$value</b></font>",$u->username)!!}</a></p>
                    <span>第{{$u->id}}名会员 · {{date('Y-m-d',strtotime($u->created_at ))}} · {{count($u->follow)}}关注者 · {{count($u->reply)}}回帖 · {{count($u->topic)}}文章</span>
                </li>
                @endforeach
                @elseif(count($topic)>0)
                @foreach($topic as $t)
                <li class="sea_topic">
                    <div class="sea_top_div"><a href="{{url('topic')}}/topics={{$t['id']}}"><span class="sea_title">{!!str_replace($value,"<font color=indianred><b>$value</b></font>",$t->title)!!}</span></a> <span>&nbsp; by&nbsp;</span> <img src="{{asset($t->profile->avatar)}}"> <span>{{$t->user->username}}</span></div>
                    <p>{{date('Y-m-d',strtotime($t->created_at ))}} · <i class="Hui-iconfont t_i">&#xe725;</i>{{$t->view_num}} · <i class="Hui-iconfont">&#xe686;</i>{{count($t->replies)}} · <i class="Hui-iconfont">&#xe697;</i>{{count($t->vote)}}</p>
                </li>
                @endforeach
                @else
            <li class="sea_none">
                没有任何数据~~
            </li>
            @endif
        </ul>
    </div>
@endsection